

// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   cy.java

package com.zelix;

import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.zip.*;

// Referenced classes of package com.zelix:
//            nc, oc, dv, fv, 
//            qb, w6, hs

public final class cy
{

    private static final String a = System.getProperty(z(z("/GpH\024:KlLH(Zs_")));
    private static final char b = a.charAt(0);
    private static final String c = System.getProperty(z(z("9OhE\024:KlLH(Zs_")));
    private static final String d = System.getProperty(z(z("&]2C[$K")));
    private String e;
    private Vector f;
    private HashMap g;
    private boolean i;
    private Vector h;
    private static Object j = new Object();
    private static String z = z(z("gMpLI:"));

    public cy(String s, boolean flag)
    {
        this(s, flag, false);
    }

    private cy(String s, boolean flag, boolean flag1)
    {
        i = flag1;
        c(s);
    }

    public void a() {
        int l = hs.c;
        if (f != null) {
            for (int k = 0; k < f.size(); k++) {
                Object obj = f.get(k);
                if (obj instanceof ZipFile) {
                    ZipFile zipfile = (ZipFile) obj;
                    try {
                        zipfile.close();
                    }
                    catch (IOException ioexception) {
                    }
                }
            }
        }
    }

    public static boolean a(String s, String s1)
    {
        boolean flag;
        w6 w6_1;
label0:
        {
            w6_1 = null;
            File file = new File(s);
            try
            {
                w6_1 = new w6(file);
            }
            catch(IOException _ex)
            {
                return false;
            }
            String s2 = a(s1, false);
            ZipEntry zipentry = w6_1.getEntry(s2);
            if(zipentry != null && !zipentry.isDirectory())
            {
                flag = true;
                if(hs.c == 0)
                    break label0;
            }
            flag = false;
        }
        if(w6_1 != null)
            try
            {
                w6_1.close();
            }
            catch(IOException ioexception) { }
        return flag;
    }

    public nc a(String s)
        throws qb
    {
        Object obj = g.get(s);
        if(obj != null)
        {
            if(obj == j)
                return null;
            if(obj instanceof File)
                return new nc((File)obj);
            if(obj instanceof dv)
            {
                dv dv1 = (dv)obj;
                ZipFile zipfile = (ZipFile)dv1.a();
                ZipEntry zipentry = (ZipEntry)dv1.b();
                return new nc(zipfile, zipentry);
            }
        }
        nc nc1 = null;
        for(int k = 0; k < f.size(); k++)
        {
            Object obj1 = f.elementAt(k);
            if(obj1 instanceof File)
            {
                nc1 = a((File)obj1, s);
                if(nc1 != null)
                    break;
                continue;
            }
            if(!(obj1 instanceof ZipFile))
                continue;
            nc1 = a((ZipFile)obj1, s);
            if(nc1 != null)
                break;
        }

        if(i && nc1 == null)
            g.put(s, j);
        return nc1;
    }

    private nc a(File file, String s)
        throws qb
    {
        String s1 = file.getAbsolutePath() + a + a(s, true);
        File file1 = new File(s1);
        if(file1.exists() && !file1.isDirectory())
            return new nc(file1);
        else
            return null;
    }

    private nc a(ZipFile zipfile, String s)
        throws qb
    {
        String s1 = a(s, false);
        ZipEntry zipentry = zipfile.getEntry(s1);
        if(zipentry != null && !zipentry.isDirectory())
            return new nc(zipfile, zipentry);
        else
            return null;
    }

    public static String a(String s, boolean flag)
    {
        if(flag)
            return s.replace('/', b) + z;
        else
            return s + z;
    }

    public Object[] a()
    {
        return f.toArray();
    }

    public static Vector a(String s, Vector vector, File file)
    {
        ArrayList arraylist;
        StringTokenizer stringtokenizer;
        int l;
        l = hs.c;
        if(file == null)
            file = oc.b;
        arraylist = new ArrayList();
        stringtokenizer = new StringTokenizer(s, c);
        while(stringtokenizer.hasMoreTokens()) {
            String s1 = stringtokenizer.nextToken();
            String s2 = oc.c(s1);
            s2 = oc.b(s2);
            if (oc.b(s2)) {
                fv fv1 = new fv();
                java.util.List list = oc.a(s2, fv1);
                if (!fv1.a()) {
                    arraylist.addAll(list);
                } else {
                    vector.add(s2);
                }
            } else {
                arraylist.add(s2);
            }
        }



        Vector vector1;
        Hashtable hashtable;
        int k;
        vector1 = new Vector(arraylist.size());
        hashtable = new Hashtable();
        for(k = 0;k<arraylist.size();k++){
        File file1;
label0:
        {
            String s3 = (String)arraylist.get(k);
            if(!a(s3, hashtable))
                continue;
            if(oc.a(s3))
            {
                file1 = new File(file, s3);
                if(l == 0)
                    break label0;
            }
            file1 = new File(s3);
        }
        if(file1.exists())
        {
            if(file1.isDirectory())
            {
                vector1.addElement(file1);
                if(l == 0)
                    continue;
            }
            try
            {
                w6 w6_1 = new w6(file1);
                vector1.addElement(w6_1);
                continue;
            }
            catch(ZipException _ex)
            {
                vector.addElement(file1.getAbsolutePath());
                continue;
            }
            catch(IOException _ex)
            {
                vector.addElement(file1.getAbsolutePath());
            }
            if(l == 0)
                continue;
        }
        vector.addElement(file1.getAbsolutePath());
        }
            return vector1;
    }

    private static boolean a(String s, Hashtable hashtable)
    {
        if(!oc.h)
            s = s.toUpperCase();
        if(!hashtable.contains(s))
        {
            hashtable.put(s, s);
            return true;
        } else
        {
            return false;
        }
    }

    public boolean b(String s) {
        String s1;
        int k;
        int l;
        l = hs.c;
        s1 = s.replace('/', b);
        for (k = 0; k < f.size(); k++) {
            Object obj = f.elementAt(k);
            if (obj instanceof File) {
                File file = (File) obj;
                String s2 = file.getAbsolutePath() + a + s1;
                File file1 = new File(s2);
                if (file1.exists() && file1.isDirectory())
                    return true;
            } else if (obj instanceof ZipFile) {
                ZipFile zipfile = (ZipFile) obj;
                ZipEntry zipentry = zipfile.getEntry(s);
                if (zipentry != null && zipentry.isDirectory())
                    return true;
            }
        }
        return false;
    }

    public void c(String s)
    {
        e = s;
        h = new Vector();
        f = a(s, h, null);
        g = new HashMap();
    }

    private static char[] z(String str) {
        char ac[] = str.toCharArray();
        int clen = ac.length;
        if (clen >= 2)
            return ac;
        ac[0] ^= 0x3a;
        return ac;
    }

    private static String z(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0:
                    key = 0x49;
                    break;
                case 1:
                    key = 46;
                    break;
                case 2:
                    key = 28;
                    break;
                case 3:
                    key =45;
                    break;
                default:
                    key =58;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }
}